<template>
    <div class='work_index'>
        <Tabs type="card" :animated="false" @on-click="click">
            <TabPane label="预约安装" name="appointment">
                <appointment v-if="currentName == 'appointment'"></appointment>
            </TabPane>
            <TabPane label="售后维修" name="afterService">
                <afterService v-if="currentName == 'afterService'"></afterService>
            </TabPane>
        </Tabs>
    </div>
</template>

<script>
import Clipboard from '../../../node_modules/clipboard/dist/clipboard'
// import util from '@/libs/util';
// import { http, methods, api } from '@/libs/http';
import appointment from '@/views/work-order/order-components/appointment'
import afterService from '@/views/work-order/order-components/afterService'
export default {
  name: 'work_index',
  created () {},
  data () {
    const clipboard = new Clipboard('.btn')
    clipboard()
    return {
      currentName: 'appointment'
    }
  },
  methods: {
    click (name) {
      // 在tab被点击之后出发,name为tab名
      this.currentName = name
    }
  },
  components: {
    appointment,
    afterService
  }
}
</script>
<style lang="less">
@import './ticket.less';
</style>
